<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:include page="/jsp/loginCheck.jsp" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Usuários</title>
		<link href="../css/estiloframes.css" rel="stylesheet" type="text/css" />
		<link href="../css/cmxform.css" rel="stylesheet" type="text/css" />
		
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script type="text/javascript" src="../js/jquery.validate.js"></script>
		<script type="text/javascript" src="../js/jquery.metadata.js"></script>
		
		<script type="text/javascript">
			$(document).ready(function() {
				$("#form").validate({meta: "validate"});
			});
		</script>
		<script> 
			function mask(f){ 
				tel=''; 
				var val =f.value.split(''); 
				for(var i=0;i<val.length;i++){ 
					if(i==1){
						val[i]=val[i]+'/';
					} 
					if(i==3){
						val[i]=val[i]+'/';
					} 
					tel=tel+val[i];
				} 
				f.value=tel; 
			} 
		</script>
	</head>
<body>
	<div id="corpo">
		<s:form action="Pesquisas" enctype="multipart/form-data" id="form" cssClass="cmxform">
			<s:hidden name="functionType" value="%{functionType}" />
			<s:hidden name="pesquisa.id" value="%{pesquisa.id}" />			
			<br/>
			<p class="titulo_texto"><s:if test="functionType == 'update'"><s:text name="Alteração"/></s:if><s:else><s:text name="Cadastro"/></s:else></p>
			<div style="padding-right:70px;"></div>
			<p><s:text name="Nome da Pesquisa:"/><br/>
				<s:textfield name="pesquisa.nome" maxlength="50" cssClass="{validate:{required:true, messages:{required:'<br/>Por favor insira o nome da Pesquisa!'}}}"/>
			</p>
			<p><s:text name="Descrição:"/><br/>
				<s:textarea name="pesquisa.descricao" rows="10" cols="50"/>
			</p>
			<p>
				<s:text name="Template da Pesquisa:"/>
				<s:if test="functionType == 'update'">
					<br/>
					<s:textarea name="pesquisa.template" rows="10" cols="50"/>
				</s:if>
				<s:else>
					<s:file name="templateFile"/>
				</s:else>						
			</p>
			<p><s:submit action="framePrincipal" type="image" src="../images/btn/voltar.png" cssClass="clicavel" align="center"/><s:text name="Voltar"/></p>
			<p><s:submit action="confirmDataPesquisas" type="image" src="../images/btn/salvar.png" cssClass="clicavel" align="center"/><s:text name="Salvar"/></p>
		</s:form>
	</div>
</body>
</html>
